package com.hancai.service.impl;

import com.hancai.entity.Employee;
import com.hancai.mapper.EmployeeMapper;
import com.hancai.service.EmployeeService;
import com.hancai.util.DBUtil;

/**
 * @author 涵菜
 * @version 1.0
 */
public class EmployeeServiceImpl implements EmployeeService {

    @Override
    public Employee login(String ename, String pwd) {
        EmployeeMapper mapper = DBUtil.getSqlSession().getMapper(EmployeeMapper.class);
        Employee employee = mapper.selectOne(ename, pwd);
        return employee;
    }

    @Override
    public int remove(int eid) {
        EmployeeMapper mapper = DBUtil.getSqlSession().getMapper(EmployeeMapper.class);
        int delete = mapper.delete(eid);
        DBUtil.closeAll();

        return delete;
    }
}
